use std::fmt::{Display, Formatter, Pointer, write};

mod unitLIstStruct;

fn main() {
    println!("Hello, world!");
}

#[derive(Debug)]
struct User {
    name: String,
    code: u32
}

#[test]
fn test01() {
    let user = User {
        code: 1423,
        name: String::from("王五"),
    };

    println!("{:#?}", user)

}


struct Person {
    name: String,
    code: u32
}

impl Display for Person {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        write!(
            f,
            "你看，这就是: {} -> {}",
            self.code, self.name
        )
    }
}

#[test]
fn test02() {
    let person = Person {
        name: String::from("李四"),
        code: 94534
    };

    println!("{}", person);

}
